<template>
  <section class="brand-story full-width-page">
    <div class="image-wrapper">
      <img src="/story.jpg" alt="品牌故事图" />
      <div class="overlay"></div>
      <div class="story-content">
        <p>{{ story.origin }}</p>
        <p><strong>创始人：</strong>{{ story.founder }}</p>
        <p><strong>使命：</strong>{{ story.mission }}</p>
      </div>
    </div>
  </section>
</template>

<script setup>
import { ref } from 'vue'

const story = ref({
  origin: 'Volcanic 咖啡诞生于一座火山脚下，旨在将原始的自然风味带给世界。',
  founder: 'Alice Smith',
  mission: '用一杯好咖啡连接人与土地的温度。'
})
</script>

<style scoped>
.brand-story {
  overflow-x: hidden;
}

/* 关键：让容器高度为视口高度 */
.image-wrapper {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* 图片填满容器 */
.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 遮罩层 */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

/* 文本居中显示在图片上 */
.story-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  color: #fff;
  text-align: center;
  max-width: 800px;
  padding: 0 20px;
}

.story-content p {
  font-size: 20px;
  line-height: 1.8;
  margin: 12px 0;
}
</style>
